#include "stm32f10x.h"                  // Device header
#include "Delay.h"
#include "OLED.h"
#include "CountSensor.h"

//停止模式+对射式红外传感器计次
int main(void){
	OLED_Init();
	CountSensor_Init();
	//配置PWR时钟
	RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR,ENABLE);
	
	OLED_ShowString(1,3,"Hello world!");
	OLED_ShowString(2,1,"Count");
	while(1){
		OLED_ShowNum(2,7,Get_Count(),5);
		
		
		OLED_ShowString(2,1,"Running:");
	//s	Delay_ms(100);
		OLED_ShowString(2,1,"        ");
		//Delay_ms(100);
		
		PWR_EnterSTOPMode(PWR_Regulator_ON, PWR_STOPEntry_WFI);	//自动配置对于标志位为0
		SystemInit();//把主频调回72MHz
	}
}
